package clientGUI.userPanels;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JTextPane;
import javax.swing.JButton;

import college.RequestTreatment;

import clientGUI.generalPanels.Controllers.InitController;
import clientserver.Client;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class InitiatorApproveClosure extends UPanel {
	
	InitController controller;
	int rid;
	
	public InitiatorApproveClosure(Client c, int id) {
		setLayout(null);
		client = c;
		rid = id;
		
		JTextPane textPane = new JTextPane();
		textPane.setBounds(93, 33, 269, 211);
		RequestTreatment rt = new RequestTreatment(client,rid);
		rt.loadfromdb();
		textPane.setText(rt.toString());
		add(textPane);
		
		JLabel lblInitiatorClosureApproval = new JLabel("INITIATOR CLOSURE APPROVAL");
		lblInitiatorClosureApproval.setBounds(152, 8, 157, 14);
		add(lblInitiatorClosureApproval);
		
		JButton btnApprove = new JButton("OK");
		btnApprove.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				controller.approveClosure(rid);
			}
		});
		btnApprove.setBounds(179, 253, 89, 23);
		add(btnApprove);
		
		JButton btnMainMenu = new JButton("Main Menu");
		btnMainMenu.setBounds(372, 43, 89, 23);
		add(btnMainMenu);
	}
}
